




function onSave(){
	
   var flag = $('#formMsg').valid();
	var formData = $("#formMsg").serializeJSON(); 
	if(flag){
			$.ajax({
			url: urlcore + "/api/machine/add",
			type: "post",
			dataType: 'json',
			contentType: "application/json;charset=utf-8",
			data: JSON.stringify(formData),
			processData: false,
			success:function(data){
				if(data.success == true){
					alert("添加成功")
					location.href="machine_list.html";
				}else{
					alert(data.msg);
				}
			},
			error:function() {
				/*alert("error");*/
			}
		});
		
	}
	 
	
	
	
}
